﻿<!--#include file="../inc/common.asp" -->

<%
    message("已作废")
    response.end
    
    call OpenDB
    Server.ScriptTimeOut = 600000
    dim sql, i
    
    
    if request("flag")="flag content" then
        sql = " alter table blog_content add flag integer "
        conn.execute(sql)
        response.write("content flag added")
    end if    
    
    if request("flag")="flag comments" then
        sql = " alter table blog_comments add flag integer "
        conn.execute(sql)
        response.write("comments flag added")
    end if    

  function toHTML(fString)
    if isnull(fString) then
        toHTML = ""
    else
        fString = Replace(fString, CHR(32), "&nbsp;")
        fString = Replace(fString, CHR(9), "&nbsp;")
        fString = Replace(fString, CHR(34), "&quot;")
        fString = Replace(fString, CHR(39), "&#39;")
        fString = Replace(fString, CHR(13), "")
        fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
        fString = Replace(fString, CHR(10), "<BR> ")
        
        toHTML = fString
    end if
  end function
  
    if request("update")="update content" then
        sql = " select top " & clng(request("count")) & " detail,flag from blog_content where content_id<3152 and flag is null order by content_id desc"
        rs.open sql, conn, 1, 3
        i=0
        while not rs.eof
            i = i+1
            rs("detail") = toHTML(rs("detail"))
            rs("flag")=1
            rs.update()
            rs.moveNext()
        wend
        rs.close()
        response.write("update content:"&i)
    end if
    
    if request("update")="update comments" then
        sql = " select top " & clng(request("count")) & " detail,flag from blog_comments where comment_id<17649 and flag is null order by comment_id desc"
        rs.open sql, conn, 1, 3
        i=0
        while not rs.eof
            i = i+1
            rs("detail") = toHTML(rs("detail"))
            rs("flag")=1
            rs.update()
            rs.moveNext()
        wend
        rs.close()
        response.write("update content:"&i)
    end if
        
%>

<form name=form1 method=post>
<input type=submit name="flag" value="flag content"><br>
<input type=submit name="flag" value="flag comments"><br>
处理条数:<input type=text name=count value=<%=request("count")%>>100<br>
<input type=submit name="update" value="update content"><br>
<input type=submit name="update" value="update comments"><br>
</form>




<!--#include file="inc/end.asp" -->